package com.hadwinling.blog.mapper;

import com.hadwinling.blog.entity.Tag;
import org.apache.ibatis.annotations.Mapper;import org.apache.ibatis.annotations.Param;import java.util.List;

/**
 * @author HadwinLing
 * @version V1.0
 * @Package com.hadwinling.blog.mapper
 * @date 2020/8/20 10:00
 */
@Mapper
public interface TagMapper {
    /**
     * delete by primary key
     *
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(Tag record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(Tag record);

    /**
     * select by primary key
     *
     * @param id primary key
     * @return object by primary key
     */
    Tag selectByPrimaryKey(Integer id);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(Tag record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(Tag record);

    /**
     * selectAllByState
     *
     * @param state
     * @return
     */
    List<Tag> selectAllByState(@Param("state") Integer state);

    List<Tag> selectAllByTopAndState(@Param("top") Integer top, @Param("state") Integer state);

    int updateTopById(@Param("updatedTop") Integer updatedTop, @Param("id") Integer id);

    int updateTagnumById(@Param("updatedTagnum")Integer updatedTagnum,@Param("id")Integer id);


}